package org.grottarossa.tms.ui.console;

import org.grottarossa.template.drivers.DriverException;
import org.grottarossa.ui.core.ApplicationSession;


public class Console
{
	private ConsolePresenter presenter;
	private ConsoleView view;
	private String id; //utilizzato per accedere al file di risorse
	private String appName;

	public Console(ConsolePresenter presenter, ConsoleView view, String m_id, String m_appName) {
		presenter.setView(view);
		view.setPresenter(presenter);
		this.setPresenter(presenter);
		this.setView(view);
		this.setId(m_id);
		this.setAppName(m_appName);

	}

	public void setPresenter(ConsolePresenter m_presenter) {
		this.presenter = m_presenter;
	}

	public ConsolePresenter getPresenter() {
		return presenter;
	}

	public void setView(ConsoleView m_view) {
		this.view = m_view;
	}

	public ConsoleView getView() {
		return this.view;
	}

	private void setId(String id) {
		this.id = id;
	}

	public String getId() {
		return this.id;
	}

	public void setAppName(String appName) {
		this.appName = appName;
	}

	public String getAppName() {
		return appName;
	}

	public void initialize(ApplicationSession appSession) throws DriverException
	{
		getView().initialize(appSession);
		getPresenter().initialize(appSession);
	}
}
